pkgname=mutilate
pkgver=git
pkgrel=1
pkgdesc="a memcached load generator designed for high request rates, good tail-latency measurements, and realistic request stream generation."
arch=('i386' 'x86_64' 'aarch64')
url="https://github.com/leverich/mutilate"
license=(BSD 3-clause "New" or "Revised" License)
depends=(scons libevent-dev gengetopt libzmq-dev memcached)
source=('https://github.com/leverich/mutilate.git')
md5sums=('SKIP')

. $LKP_SRC/lib/install.sh

patch_source() {
	cd "$srcdir/mutilate"

	# if scons isn't python3 version, no need apply patch
	scons -v | grep -q "python3" || return 0

	patch -p1 < "$(get_pkg_dir ${pkgname})/0001-SConstruct-update-to-python3-version.patch"
}

build()
{
	cd "$srcdir/mutilate"
	scons
}

package()
{
	install -D "$srcdir/$pkgname/mutilate" "$pkgdir/usr/local/bin/mutilate"
}
